package com.yan.utils;

import java.util.HashMap;
import java.util.Map;

import com.yan.utils.EnumUtil.ChatType;

public class EnumTest {

	public enum ResultType {
		MON, TUE, WED, THU, FRI, SAT, SUN;
	}

	public enum DateResultType {
		MON("1"), TUE("2"), WED("3"), THU("4"), FRI("5"), SAT("6"), SUN("7");

		private String type;
		private static final Map<String, DateResultType> map = new HashMap<String, DateResultType>();

		DateResultType(String type) {
			this.type = type;
		}

		static {
			for (DateResultType dateResultType : DateResultType.values()) {
				map.put(dateResultType.type, dateResultType);
			}
		}

		public String getType() {
			return type;
		}

		public void setType(String type) {
			this.type = type;
		}

	}

	public enum ChatResult {
		BLOCKED_LIST(1010, "您已被禁言"), SUCCESS(1000, "发送成功"), WORD_LIMIT(1011, "发送失败，字数超过限制");

		private int code;

		private String msg;

		ChatResult(int code, String msg) {
			this.code = code;
			this.msg = msg;
		}

		public int getCode() {
			return code;
		}

		public void setCode(int code) {
			this.code = code;
		}

		public String getMsg() {
			return msg;
		}

		public void setMsg(String msg) {
			this.msg = msg;
		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		for (ResultType type : ResultType.values()) {
			// System.out.println(type);
		}

		for (DateResultType resultType : DateResultType.values()) {
			System.out.println(resultType.name() + " " + resultType.type);
		}

		System.out.println(DateResultType.FRI + "  " + DateResultType.FRI.name() + " " + DateResultType.FRI.type + " "
				+ DateResultType.MON.ordinal() + " " + DateResultType.FRI.getType() + " " + DateResultType.map);

		System.out.println(ChatResult.BLOCKED_LIST.code + "  " + ChatResult.BLOCKED_LIST.msg + "  "
				+ ChatResult.BLOCKED_LIST.getCode() + "  " + ChatResult.BLOCKED_LIST.getMsg());
	}

}
